package com.rcnie.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rcnie.dto.DishDto;
import com.rcnie.entity.Dish;
import com.rcnie.entity.UserDishScore;
import com.rcnie.mapper.DishMapper;
import com.rcnie.service.DishService;
import com.rcnie.service.UserDishScoreService;
import com.rcnie.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.ArrayList;
import java.util.List;

@Service
public class DishServiceImpl extends ServiceImpl<DishMapper, Dish> implements DishService {

    private UserDishScoreService userDishScoreService;

    /**
     * rcyang
     * 根据位置返回dish数据
     * @return
     */
//    public DishDto selectDish(int userId,Dish dish){
//        //实现类
//        userDishScoreService = new UserDishScoreImpl();
//        //查询出所有的数据，返回
//        LambdaQueryWrapper<Dish> lambdaQueryWrapper = new LambdaQueryWrapper<>();
//        lambdaQueryWrapper.eq(Dish::getLocation,dish.getLocation());
//        List<Dish> list = this.list(lambdaQueryWrapper);
//        //查询dishUserScore
//        LambdaQueryWrapper<UserDishScore> lambdaQueryWrapper1 = new LambdaQueryWrapper<>();
//        lambdaQueryWrapper1.eq(UserDishScore::getUserId,userId);
////        lambdaQueryWrapper1.eq(UserDishScore::getDishId,dish.getLocation());
//        List<UserDishScore> list1 = userDishScoreService.list(lambdaQueryWrapper1);
//
//
//        DishDto dishDto = new DishDto();
//        dishDto.setDish(list);
//        Dish dish1 = list.get(0);
//        System.out.println(dish1);
//
//        return dishDto;
//    }
}
